SUBROUTINE RADIO1
     * Simple form including 3 groups of radio buttons

     * Include the RealWeb definitions
     INCLUDE #RW.INCLUDE.DEFS FROM /SYSFILES/REALWEB,BP

     * Start the HTML page.
     CALL RW_START_HTML_PAGE("Form with Radio Buttons", "", "", "", "")

     CALL RW_PUT("Please enter your name in the box")

     * Start the HTML form, specifying that the subroutine THANKS should be run
     * when the submit button is clicked
     CALL RW_START_HTML_FORM("THANKS","FORM2","")
     
     * Display the editbox
     CALL RW_EDIT_BOX("EDITBOX",30,"3")
     CALL RW_NEWLINES(2)

     CALL RW_PUT("Please indicate your gender")
     * Display group of 2 radio buttons
     CALL RW_NEWLINE
     CALL RW_RADIO("sex","M","","")
     CALL RW_PUT("Male")
     CALL RW_NEWLINE
     CALL RW_RADIO("sex","F","","")
     CALL RW_PUT("Female")
     CALL RW_NEWLINES(2)

     CALL RW_PUT("Your age group")
     * Display group of 4 radio buttons
     CALL RW_NEWLINE
     CALL RW_RADIO("age","1","","")
     CALL RW_PUT("Under 25")
     CALL RW_NEWLINE
     CALL RW_RADIO("age","2","","")
     CALL RW_PUT("25 - 40")
     CALL RW_NEWLINE
     CALL RW_RADIO("age","3","","")
     CALL RW_PUT("40 - 55")
     CALL RW_NEWLINE
     CALL RW_RADIO("age","4","","")
     CALL RW_PUT("Over 55")     
     CALL RW_NEWLINES(2)

     CALL RW_PUT("and please tell us where you get most of your books")
     * Display group of 3 radio buttons
     CALL RW_NEWLINE
     CALL RW_RADIO("source","S","","")
     CALL RW_PUT("High Street Bookshop")
     CALL RW_NEWLINE
     CALL RW_RADIO("source","I","","")
     CALL RW_PUT("Internet Bookshop")
     CALL RW_NEWLINE
     CALL RW_RADIO("source","L","","")
     CALL RW_PUT("Local Library")
     CALL RW_NEWLINES(2)

     * Create the submit button
     CALL RW_SUBMIT_BUTTON("Submit Details","")

     *Complete the form
     CALL RW_END_FORM

     * Complete the page
     CALL RW_END_PAGE
RETURN

Go to top button